﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomActionGroup Id="SiteSettingsCustomGroup"
    Title="Extended Details"
    ImageUrl="_layouts/images/SiteSettings_SiteCollectionAdmin_48x48.png"
    Location="Microsoft.SharePoint.SiteSettings"
    RequiredAdmin="Delegated"
    Sequence="100" />
  
  <CustomAction Id="SiteAdminAction"
    Title="View/Modify Extended Details"
    Location="Microsoft.SharePoint.SiteSettings"
    GroupId="SiteSettingsCustomGroup"
    Sequence="1000" >
    <UrlAction Url="javascript:void(SP.UI.ModalDialog.showModalDialog({url:'{SiteUrl}/_layouts/SharePointExtendedDetailsFeature/Details.aspx?IsDlg=1%26SiteUrl={SiteUrl}',title: 'Site Extended Details'}))"/>
  </CustomAction>
  
  <CustomAction Id="Custom.Configuration.ListCustomSettings"
    Title="View/Modify Extended Details"
    Location="Microsoft.SharePoint.ListEdit"
    RequireSiteAdministrator="false"
    GroupId="GeneralSettings"
    Sequence="1000" >
    <UrlAction Url="javascript:void(SP.UI.ModalDialog.showModalDialog({url:'{SiteUrl}/_layouts/SharePointExtendedDetailsFeature/Details.aspx?IsDlg=1%26ListId={ListId}',title: 'List Extended Details'}))"/>
  </CustomAction>

  <CustomAction Id="LibraryExtendedDetailsRibbonButton"
                RegistrationId="101"
                RegistrationType="List"
                Location="CommandUI.Ribbon"
                Sequence="100"
                Title="View/Modify Extended Details">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Library.Settings.Controls._children">
          <Button Id="Ribbon.Library.New.LibraryExtendedDetailsRibbonButton"
                  Alt="View/Modify Extended Details"
                  Sequence="5"
                  Command="List_Extended_Details_Ribbon_Button"
                  Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png"
                  Image32by32Top="-96"
                  Image32by32Left="-448"
                  LabelText="Extended Details"
                  TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
            Command="List_Extended_Details_Ribbon_Button"
            CommandAction="javascript:
             function openExtendedDetailsWindow()
             {
                var listId = SP.ListOperation.Selection.getSelectedList();
                var siteUrl = L_Menu_BaseUrl;
                var redirectUrl = siteUrl + '/_layouts/SharePointExtendedDetailsFeature/Details.aspx?ListId=' + listId;
                SP.UI.ModalDialog.showModalDialog({url: redirectUrl,title: 'List Extended Details'});
             }
             openExtendedDetailsWindow();" />
        </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

  <CustomAction Id="ListExtendedDetailsRibbonButton"
                RegistrationId="100"
                RegistrationType="List"
                Location="CommandUI.Ribbon"
                Sequence="100"
                Title="View/Modify Extended Details">
    <CommandUIExtension>
      <CommandUIDefinitions>
         <CommandUIDefinition Location="Ribbon.List.Settings.Controls._children">
          <Button Id="Ribbon.List.New.ListExtendedDetailsRibbonButton"
                  Alt="View/Modify Extended Details"
                  Sequence="5"
                  Command="List_Extended_Details_Ribbon_Button"
                  Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png"
                  Image32by32Top="-96"
                  Image32by32Left="-448"
                  LabelText="Extended Details"
                  TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
           Command="List_Extended_Details_Ribbon_Button"
          CommandAction="javascript:
           function openExtendedDetailsWindow()
           {
              var listId = SP.ListOperation.Selection.getSelectedList();
              var siteUrl = L_Menu_BaseUrl;
              var redirectUrl = siteUrl + '/_layouts/SharePointExtendedDetailsFeature/Details.aspx?ListId=' + listId;
              SP.UI.ModalDialog.showModalDialog({url: redirectUrl,title: 'List Extended Details'});
           }
           openExtendedDetailsWindow();" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

</Elements>
